<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Vue中的插槽（slot）</title>
  <script src="../asset/js/vue.js"></script>
</head>

<body>
  <div id="root">
    <child>
      <!-- <p>Dell</p> -->
    </child>
  </div>
  <script>
    /* slot用来显示<p>Dell</p> */
    Vue.component('child', {
      template: `<div><p>hello</p><slot>默认内容</slot></div>`
    })
    let vm = new Vue({
      el: '#root'
    })
  </script>
</body>

</html>